import java.awt.Font;
import java.awt.LayoutManager;
import java.awt.Rectangle;

import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
/**
 * Allow user to Update user freeze status
 * 
 *
 */
public class UpdateFreeze extends JPanel {

	private static final long serialVersionUID = 1L;
	private JLabel jlblTitle = null;
	private JLabel jlblUserName = null;
	public JTextField jtxtUserName = null;
	public JCheckBox jchbFreeze = null;
	public JButton jbtnUpdate = null;
	public JButton jbtnBack = null;
	/**
	 * Create and initializes UpdateFreeze
	 */
	public UpdateFreeze() {
		// TODO Auto-generated constructor stub
		super();
		initialize();
	}

	public UpdateFreeze(LayoutManager layout) {
		super(layout);
		// TODO Auto-generated constructor stub
		initialize();
	}

	public UpdateFreeze(boolean isDoubleBuffered) {
		super(isDoubleBuffered);
		// TODO Auto-generated constructor stub
		initialize();
	}

	public UpdateFreeze(LayoutManager layout, boolean isDoubleBuffered) {
		super(layout, isDoubleBuffered);
		// TODO Auto-generated constructor stub
		initialize();
	}

	/**
	 *initializes this
	 * 
	 * 
	 */
	private void initialize() {
		jlblUserName = new JLabel();
		jlblUserName.setBounds(new Rectangle(31, 61, 76, 31));
		jlblUserName.setText("UserName :");
		jlblTitle = new JLabel();
		jlblTitle.setBounds(new Rectangle(25, 15, 279, 32));
		jlblTitle.setFont(new Font("Dialog", Font.BOLD, 18));
		jlblTitle.setText("Freeze/Unfreeze User Account");
		this.setSize(342, 209);
		this.setLayout(null);
		this.add(jlblTitle, null);
		this.add(jlblUserName, null);
		this.add(getJtxtUserName(), null);
		this.add(getJchbFreeze(), null);
		this.add(getJbtnUpdate(), null);
		this.add(getJbtnBack(), null);
	}

	/**
	 * initializes jtxtUserName	
	 * 	
	 * @return JTextField	
	 */
	private JTextField getJtxtUserName() {
		if (jtxtUserName == null) {
			jtxtUserName = new JTextField();
			jtxtUserName.setBounds(new Rectangle(136, 61, 153, 29));
		}
		return jtxtUserName;
	}

	/**
	 * initializes jchbFreeze	
	 * 	
	 * @return JCheckBox	
	 */
	private JCheckBox getJchbFreeze() {
		if (jchbFreeze == null) {
			jchbFreeze = new JCheckBox();
			jchbFreeze.setBounds(new Rectangle(98, 103, 162, 32));
			jchbFreeze.setText("Freeze");
		}
		return jchbFreeze;
	}

	/**
	 * initializes jbtnUpdate	
	 * 	
	 * @return JButton	
	 */
	private JButton getJbtnUpdate() {
		if (jbtnUpdate == null) {
			jbtnUpdate = new JButton();
			jbtnUpdate.setBounds(new Rectangle(20, 149, 179, 34));
			jbtnUpdate.setText("Update");
			
		}
		return jbtnUpdate;
	}

	/**
	 * initializes jbtnBack	
	 * 	
	 * @return JButton
	 */
	private JButton getJbtnBack() {
		if (jbtnBack == null) {
			jbtnBack = new JButton();
			jbtnBack.setBounds(new Rectangle(226, 150, 75, 35));
			jbtnBack.setText("Back");
			
		}
		return jbtnBack;
	}
	/**
	 * Set jtxtUserName to st and jchbFreeze to freeze
	 * @param freeze if freeze==1 jchbFreeze is selected
	 * @param st text which will be in jtxtUserName
	 */
	public void lsetfreeze(int freeze,String st)
	{
		jtxtUserName.setText(st);
		jtxtUserName.setEnabled(false);
		if(freeze>=1)
			jchbFreeze.setSelected(true);
		else
			jchbFreeze.setSelected(false);
	}

}  
